/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utilidades;

import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.WindowConstants;

/**
 *
 * @author Snailin
 */
public class Pantalla {
	private static Pantalla instancia = null;
	private Toolkit tk = null;
	private Dimension tamano = null;

	public static Pantalla getInstancia() {
		if (instancia == null) {
			instancia = new Pantalla();
		}
		return instancia;
	}

	public Pantalla() {
		tk = Toolkit.getDefaultToolkit();
		tamano = tk.getScreenSize();
	}

	public void setFullScreen(JFrame... frames) {
		for (JFrame frame : frames) {
			frame.setSize(tamano);
			cerrarVentanas(frame);
		}
	}

	private void cerrarVentanas(JFrame frame) {
		frame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
	}
}
